
#include <string>
#include "lexer.hpp"
#include "gtest/gtest.h"

using std::string;

TEST(LexerTests, EmptyInput) {
  TokenStream ts = Lexer().getTokenStream();
  ASSERT_TRUE(ts.empty());
}

/*TEST(LexerTests, BasicTest) {
  EXPECT_NO_THROW(
    Lexer lexer(" 123   abc var  ");
  ); 
  Lexer lexer(" 123   abc var  ");
  ASSERT_TRUE(lexer.hasMoreTokens());
  EXPECT_EQ(lexer.nextToken().type, INTEGER_NUMBER);
  ASSERT_TRUE(lexer.hasMoreTokens());
  Token t = lexer.nextToken();
  EXPECT_EQ(t.type, IDENTIFIER);
  EXPECT_EQ(t.lexeme, "abc");
  ASSERT_TRUE(lexer.hasMoreTokens());
  t = lexer.nextToken();
  EXPECT_EQ(t.type, DEF_KEYWORD);
  ASSERT_EQ(t.lexeme, "var");
  ASSERT_FALSE(lexer.hasMoreTokens());
  EXPECT_THROW(lexer.nextToken(), Lexer::EndOfTokenStreamException);
}

TEST(LexerTests, InvalidInput) {
  EXPECT_THROW(Lexer lexer("&"), Lexer::UnknownLexemeException);
  EXPECT_THROW(Lexer lexer("1.134_3"), Lexer::UnknownLexemeException);
  EXPECT_THROW(Lexer lexer("+-23$42+-"), Lexer::UnknownLexemeException);
}
*/